<?
$products = Products();
$tut_cat = new TemplateTutorials();
$list_cat_tut = $tut_cat->ListCatTutorials();
?>
<div class="pageHead w1130">
   <a href="/"><div class="logo"></div></a>
   <div class="pageName">
      <a href="/"><p>MassSeo<span>.vn</span></p></a>
   </div>
   <div class="headBar">
      <ul>
         <li class="<?=($HomePage == true) ? 'menu_active':''?>"><a href="/">Trang Chủ</a></li>
         <li class="li_pro <?=($productsPage == true) ? 'menu_active':''?>" >
            <a href="/phan-mem/">Phần mềm</a>
            <div class="product_menu">
               <div class="f_product">
                  <?
                     foreach($products as $row){
                  ?>
                     <div class="product_once">
                        <a href="<?=generate_product_detail_url($row)?>"><img alt="<?=$row['pro_name']?>" src="<?=PATH_PICTURE_PRODUCT.$row['pro_image_tiny']?>"/></a>
                        <div class="product_description">
                           <a href="<?=generate_product_detail_url($row)?>"><p class="product_name" title="<?=$row['pro_name']?>"><?=$row['pro_name']?></p></a>
                           <p class="product_summary" title="<?=$row['pro_title']?>"><?=$row['pro_title']?></p>
                        </div>
                     </div>
                     <p class="p_line"></p>
                  <?
                     }
                  ?>
                  <a href="/phan-mem/" class="view_all"><span class="view_all_text">Xem tất cả </span><span class="arrow"></span></a>
               </div>
            </div>
         </li>
         <li class="li_tut <?=($tutorialPage == true) ? 'menu_active':''?>">
            <a href="/huong-dan/" class="a_tut">Hướng Dẫn</a>
            <div class="tutorials_menu">
               <div class="f_product">
                  <?
                  foreach($list_cat_tut as $cat_tut_item) {
                      ?>
                      <div class="product_once"><a href="<?=generate_tutorials_cat_url($cat_tut_item)?>" title="<?=$cat_tut_item['cat_name']?>"><?=$cat_tut_item['cat_name']?></a></div>
                      <p class="p_line"></p>
                      <?
                  }
                  ?>
                  <a href="/huong-dan/" class="view_all"><span class="view_all_text">Xem tất cả </span><span class="arrow"></span></a>
               </div>
            </div>
         </li>
         <li class="<?=($productsDownloadPage == true) ? 'menu_active':''?>"><a href="/download/">Download</a></li>
         <li><a href="/lien-he.html">Liên Hệ</a></li>
      </ul>
   </div>
   <div class="LoginRegister">
      <ul>
    <?
    $myuser = new user();
    if($myuser->logged() == 1) {
        ?>
        <li>
            <a href="/thanh-vien"><span title="<?=$myuser->use_name?>" class="user_name" style="font-weight: bold;"><?=$myuser->use_name?></span></a>
            <a href="javascript:;" class="door_down_inner">
               <img class="arrow_down" src="<?=PATH_IMAGE_THEME?>arrow_down.png"/>
            </a>
            <ul class="user_inf_box">
               <li><a href="/thanh-vien">Trang cá nhân</a></li>
               <li><a href="/logout" style="color: red;margin-right: 5px;">Thoát</a></li>
            </ul>
         </li>
        <?
    }
    else {
        ?>
        <li><a href="/dang-nhap.html">Đăng nhập</a></li>
        <li>/<a href="/dang-ky.html">Đăng ký</a></li>        
        <?
    }
    ?>
    </ul>
   </div>
   <?if($HomePage == false){?>
      <div class="arrow_top <?=($productsPage == true) ? 'arrow_product':''?> <?=($tutorialPage == true) ? 'arrow_tutorial':''?> <?=($productsDownloadPage == true) ? 'arrow_download':''?>"><img src="../../../themes/img/arrow_top.png"/></div>
   <? } ?>
</div>
<script>
$("body").click(function(e){
   if(e.target.className != "door_down_inner" && e.target.className != "arrow_down"){
      if($(".door_down_inner").hasClass("open_door")){
         $(".door_down_inner").removeClass("open_door");
         $(".arrow_down").removeClass("rotate_arrow");
         $(".user_inf_box").css({"display":"none","z-index":"0"});
      }
      
   }else{
         $(".door_down_inner").addClass("open_door");
         $(".door_down").css({'border-color':'#333'});
         $(".arrow_down").addClass("rotate_arrow");
         $(".user_inf_box").css({"display":"block","position":"absolute","z-index":"3334",});
      } 
   })     
</script>